package com.lst.api.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: Frank
 * @date: 2019/12/30 14:33
 * @version: V1.0
 */
public enum ApplyTypeEnum {

    PERSON("1", "个人"),
    COMPANY("2", "企业");

    ApplyTypeEnum(String key, String value){
        this.key = key;
        this.value = value;
    }

    private String key;
    private String value;

    private static final Map<String, ApplyTypeEnum> KEY_MAP = new HashMap<>();

    static{
        for (ApplyTypeEnum item : ApplyTypeEnum.values()) {
            KEY_MAP.put(item.getKey(), item);
        }
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static ApplyTypeEnum getByKey(String key) {
        return KEY_MAP.get(key);
    }
}
